#include <stdio.h>
void compare(int* x,int* y)
{
	int temp;
	temp = *x;
	*x = *y;
	*y = temp;
}

int main()
{
	int a[10] = {0};
	int b[10] = {0};
	for (int i = 0; i < 10; i++)
	{
		scanf("%d",&a[i]);
	}
	for (int i = 0; i < 10; i++)
	{
		scanf("%d",&b[i]);
		compare(&a[i],&b[i]);
	}
	for (int i = 0; i < 10; i++)
	{
		printf("%d ",a[i]);
	}
	printf("\n");
	for (int i = 0; i < 10; i++)
	{
		printf("%d ",b[i]);
	}
	return 0;
}
